From 95345a2afadc9df4eb7bc55f8f1c76e128e8b32f Mon Sep 17 00:00:00 2001 From: Rupert Weber Date: Wed, 1 Sep 2010 18:16:10 +0200 Subject: [PATCH] docs: fixed example code in index-static.html.in added babl_init(), fish can't be const, Babl* can't be dereferenced, one variable name changed during example, added sizeof to make it a little more obvious. --- docs/index-static.html.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/index-static.html.in b/docs/index-static.html.in index af6ab13..9127121 100644 --- a/docs/index-static.html.in +++ b/docs/index-static.html.in @@ -220,17 +220,19 @@ int width = 123, height = 581, pixel_count = width * height; const Babl *srgb = babl_format ("R'G'B' u8"); const Babl *lab = babl_format ("CIE Lab float"); -const Babl *rgb_to_lab_fish = babl_fish (srgb, lab); +Babl *rgb_to_lab_fish = babl_fish (srgb, lab); float *lab_buffer; unsigned char *srgb_buffer; -srgb_buffer = malloc (pixel_count * srgb->format.bytes_per_pixel); -lab_buffer = malloc (pixel_count * 3 * 4); +babl_init (); + +srgb_buffer = malloc (pixel_count * babl_format_get_bytes_per_pixel (srgb)); +lab_buffer = malloc (pixel_count * 3 * sizeof (float)); ...... load data into srgb_buffer ....... -babl_process (bablfish, srgb_buffer, lab_buffer, pixel_count); +babl_process (rgb_to_lab_fish, srgb_buffer, lab_buffer, pixel_count); ...... do operation in lab space ........ -- 2.30.2